import request from '@/utils/request'

export const stepStatus = [
  {id: 9,name: '过期-已完成',value: 1},
  {id: 8,name: '过期-已就绪',value: 6},
  {id: 7,name: '过期-执行中',value: 2},
  {id: 5,name: '已过期',value: 5},
  {id: 3,name: '未开始',value: 3},
  {id: 2,name: '执行中',value: 2},
  {id: 1,name: '已完成',value: 1}
]

export const typeStatus = [
  {id: 3,name: '测试'},
  {id: 2,name: '学习'},
  {id: 1,name: '通用'},
]

// 查询单词学习任务列表
export function listStep(query) {
  return request({
    url: '/system/step/list',
    method: 'get',
    params: query
  })
}

// 查询单词学习任务详细
export function getStep(id) {
  return request({
    url: '/system/step/' + id,
    method: 'get'
  })
}

// 新增单词学习任务
export function addStep(data) {
  return request({
    url: '/system/step',
    method: 'post',
    data: data
  })
}

// 修改单词学习任务
export function updateStep(data) {
  return request({
    url: '/system/step',
    method: 'put',
    data: data
  })
}

// 删除单词学习任务
export function delStep(id) {
  return request({
    url: '/system/step/' + id,
    method: 'delete'
  })
}

// 查询单词学习任务详情列表
export function listTask_detail(query) {
  return request({
    url: '/record/task_detail/list',
    method: 'get',
    params: query
  })
}

// 查询单词学习任务详情详细
export function getTask_detail(id) {
  return request({
    url: '/record/task_detail/' + id,
    method: 'get'
  })
}

// 新增单词学习任务详情
export function addTask_detail(data) {
  return request({
    url: '/record/task_detail',
    method: 'post',
    data: data
  })
}

// 修改单词学习任务详情
export function updateTask_detail(data) {
  return request({
    url: '/record/task_detail',
    method: 'put',
    data: data
  })
}

export function updateTask_start(data) {
  return request({
    url: '/record/task_detail/start',
    method: 'put',
    data: data
  })
}

// 删除单词学习任务详情
export function delTask_detail(id) {
  return request({
    url: '/record/task_detail/' + id,
    method: 'delete'
  })
}

export function getMyList(id) {
  return request({
    url: '/record/taskAddstudent/myList/' + id,
    method: 'get'
  })
}


export function getMyListAll() {
  return request({
    url: '/record/taskAddstudent/myList',
    method: 'get'
  })
}

export function receiveMyList(id) {
  return request({
    url: '/record/taskAddstudent/receive/' + id,
    method: 'get'
  })
}

// 查询单词学习任务列表
export function listTaskAddstudent(query) {
  return request({
    url: '/record/taskAddstudent/list',
    method: 'get',
    params: query
  })
}

// 查询单词学习任务详细
export function getTaskAddstudent(id) {
  return request({
    url: '/record/taskAddstudent/' + id,
    method: 'get'
  })
}

// 新增单词学习任务
export function addTaskAddstudent(data) {
  return request({
    url: '/record/taskAddstudent',
    method: 'post',
    data: data
  })
}

// 修改单词学习任务
export function updateTaskAddstudent(data) {
  return request({
    url: '/record/taskAddstudent',
    method: 'put',
    data: data
  })
}

// 删除单词学习任务
export function delTaskAddstudent(id) {
  return request({
    url: '/record/taskAddstudent/' + id,
    method: 'delete'
  })
}

// 查询单词学习进程列表
export function listStep_progress(query) {
  return request({
    url: '/record/step_progress/list',
    method: 'get',
    params: query
  })
}

// 查询单词学习进程列表
export function listStep_progressAll(query) {
  return request({
    url: '/record/step_progress/listAll',
    method: 'get',
    params: query
  })
}

export function listStep_progress_user(query) {
  return request({
    url: '/record/step_progress/user',
    method: 'get',
    params: query
  })
}

// 查询单词学习进程详细
export function getStep_progress(id) {
  return request({
    url: '/record/step_progress/' + id,
    method: 'get'
  })
}

// 新增单词学习进程
export function addStep_progress(data) {
  return request({
    url: '/record/step_progress',
    method: 'post',
    data: data
  })
}

// 修改单词学习进程
export function updateStep_progress(data) {
  return request({
    url: '/record/step_progress',
    method: 'put',
    data: data
  })
}

// 删除单词学习进程
export function delStep_progress(id) {
  return request({
    url: '/record/step_progress/' + id,
    method: 'delete'
  })
}